<!--  -->
<template>
  <div class="app">
    <top-tit :tit="'收银台'"></top-tit>
    <div class="tit">
      <div class="container">商品信息</div>
    </div>

    <div class="good_item">
      <div class="container">
        <div class="img_box">
          <img src="@/assets/img/vipBuy-icon.png" alt="" />
        </div>
        <div class="good_info">
          <p class="good_name" v-text="payInfo.good_name"></p>
          <p class="good_type">VIP会员</p>
          <p class="good_charge"><span>￥</span> <span v-text="payInfo.good_charge"></span></p>
        </div>
      </div>
    </div>

    <div class="discount_code">
      <div class="container">
        <div class="name">使用优惠码</div>
        <div class="icon">
          <img src="@/assets/img/next.png" alt="" />
        </div>
      </div>
    </div>

    <div class="pay_type">
      <div class="container">
        <div class="pay_type_item">
        <div class="icon">
          <img src="@/assets/img/pay-icon.png" alt="" />
        </div>
        <div class="name">手动打款</div>
      </div>
      <div class="check">
        <img src="@/assets/img/check-icon.png" alt="" />
      </div>
      </div>
    </div>

    
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import topTit from "@/components/topTit";
import { Toast } from "vant";
import router from "@/router";
export default {
  name: "checkOut",
  //import引入的组件需要注入到对象中才能使用
  components: {
    topTit,
  },
  data() {
    //这里存放数据
    return {
      token: localStorage.getItem("h5-token"),
      payInfo: "",
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  async created() {
    let data = this.$route.query;
    if (data.good_id == undefined) {
      localStorage.removeItem("h5-token");
      this.$router.push({
        path: "/",
      });
      return;
    }
    this.payInfo = data;
    // console.log(this.payInfo);
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped lang="less">
.app {
  // background-color: #f6f6f6;
  height: 100%;
}
div.tit {
  width: 100%;
  height: 0.28rem;
  font-weight: 400;
  color: #333;
  border-top: 10px solid #f6f6f6;
  margin-bottom: 30px;
  padding-top: 15px;
  div.container {
    width: 6.9rem;
    text-align: start;
    height: 0.28rem;
    font-size: 0.28rem;
    line-height: 0.28rem;
  }
}

div.good_item {
  padding-top: 20px;
  margin-bottom: 30px;
  div.container {
    width: 6.9rem;
    height: 1.5rem;
    display: flex;
    div.img_box {
      width: 2rem;
      height: 1.5rem;
      margin-right: 0.3rem;
      img {
        width: 2rem;
        height: 1.5rem;
      }
    }

    div.good_info {
      width: 4.5538rem;
      text-align: start;

      p.good_name {
        height: 0.3rem;
        font-size: 0.3rem;
        font-weight: 600;
        color: #333;
        line-height: 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 2px;
        margin-bottom: 10px;
      }

      p.good_type {
        height: 0.26rem;
        font-size: 0.26rem;
        font-weight: 400;
        color: #ff4d4f;
        line-height: 0.26rem;
        margin-bottom: 0.36rem;
      }
    }

    p.good_charge {
      height: 0.3rem;
      font-size: 0.3rem;
      font-weight: 600;
      color: #fd3968;
      line-height: 0.3rem;
    }
  }
}

div.discount_code {
  height: 1.14rem;
  .container {
    width: 6.9rem;
     height: 1.14rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    div.name {
      text-align: start;
      font-size: 0.3rem;
      line-height: 0.3rem;
    }

    div.icon {
      img {
        width: 0.38rem;
        height: 0.38rem;
      }
    }
  }
}

div.pay_type {
  height: 1.8rem;
  .container{
    width: 6.9rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    div.pay_type_item {
      display: flex;
      justify-content: start;
      align-items: center;
    div.icon {
      width: .6rem;
      height: .6rem;
      margin-right: 10px;
      img {
        width: .6rem;
      height: .6rem;
      }
    }

    div.name {
      font-size: .36rem;
      color: #333;
    }
  }

  div.check {
    width: .48rem;
      height: .48rem;
    img {
      width: .48rem;
      height: .48rem;
    }
  }
  }
}
</style>
